/*
 * @(#)NewsOnlineSyncService.java 2011-12-26
 *
 * Copyright 2011 北龙中网（北京）科技有限责任公司. All rights reserved.
 */
package cn.shangjia.shop.sync.service.impl;

import org.springframework.stereotype.Service;

import cn.shangjia.common.domain.NewsOnline;
import cn.shangjia.shop.dao.AbstractCacheDao.CacheType;
import cn.shangjia.shop.sync.service.AbstractCacheService;

/**
 *
 * @author <a href="mailto:jinzhongze@knet.cn">jinzhongze</a>
 * @version 1.0, 2011-12-26 19:40:51
 * @since 1.0
 */
@Service
public class NewsOnlineSyncService extends AbstractCacheService<NewsOnline> {
	
	/*
	 * (non-Javadoc)
	 * @see cn.shangjia.shop.sync.service.AbstractCacheService#repo(cn.shangjia.common.domain.Domain)
	 * 浏览量和回复量 是在缓存中保存的
	 */
	@Override
	protected void repo(NewsOnline po) {
		super.repo(po);
		String key = dao.getKey(CacheType.OBJ, po.getId());
		NewsOnline cache = dao.get(key);
		if (cache == null)
			return;
		po.setVisitNum(cache.getVisitNum());
		po.setReplyNum(cache.getReplyNum());
	}
	
	/*
	 * (non-Javadoc)
	 * @see cn.shangjia.shop.sync.service.AbstractCacheService#isRemoveListCache()
	 */
	@Override
	protected boolean isRemoveListCache() {
		return true; //清理缓存列表
	}
	
}
